```
Feature: Basic admin's features
Scenario: Create a user by email/password with valid admin token
When I create a user with a valid admin token
Then I should get status 200
Scenario: Create a user by email/password with invalid admin token
When I create a user with an invalid admin token
Then I should get status 403
```
| Summary Item | Total | Failed |
|---|---|---|
| Requests | 5 | 0 |
| Prerequest Scripts | 7 | 0 |
| Test Scripts | 10 | 0 |
| Assertions | 7 | 3 |
| Skipped Tests | 0 | - |
expected response to have status code 200 but got 403
expected response to have status code 200 but got 403
expected response to have status code 200 but got 403
| Header Name | Header Value |
|---|---|
| Content-Type | application/x-www-form-urlencoded |
| Pragma | no-cache |
| Accept | application/json, text/plain, */* |
| Host | varnish |
| User-Agent | PostmanRuntime/7.26.8 |
| Cache-Control | no-cache |
| Postman-Token | d06d5e13-94fd-404e-96cf-9cc293d3eadf |
| Accept-Encoding | gzip, deflate, br |
| Connection | keep-alive |
| Content-Length | 211 |
{"grant_type":"password","client_id":"sDDOEtsfJmfydw6Uos3F_YewFNoDzrxdsKN96OQK9e","client_secret":"HqP-3AgvmsFPOGFT9hsBx0F6a5xLc5NTQ5hxIz3Jfj","username":"admin@whoozer.fr","password":"wh00zerp0w3r","scope":"mobile_app admin_scopes"}
| Header Name | Header Value |
|---|---|
| Date | Tue, 26 Jan 2021 13:30:17 GMT |
| Content-Type | application/json |
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | GET, POST, PUT, DELETE, PATCH, OPTIONS |
| Access-Control-Max-Age | 0 |
| Access-Control-Allow-Headers | Authorization, Content-Type, X-Happn-CID, X-Happn-DID, X-HAPPN-VERSION, X-HAPPN-CARRIER-COUNTRY |
| X-Backend | legacy |
| Age | 0 |
| Cache-Control | max-age=0, no-cache, no-store, must-revalidate |
| Content-Length | 1372 |
| Connection | keep-alive |
{"success":false,"status":403,"error":"invalid_client","data":{"trace":"#0 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(212): Auth\\Service\\AuthService->extractAndValidateAuthParams(Array)\n#1 \/var\/www\/happn-api\/application\/modules\/connect\/controllers\/OauthController.php(53): Auth\\Service\\AuthService->grantAccessToken(Array)\n#2 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Action.php(516): Connect_OauthController->tokenAction()\n#3 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Dispatcher\/Standard.php(308): Zend_Controller_Action->dispatch('tokenAction')\n#4 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#5 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application\/Bootstrap\/Bootstrap.php(105): Zend_Controller_Front->dispatch()\n#6 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()\n#7 \/var\/www\/happn-api\/public\/index.php(102): Zend_Application->run()\n#8 {main}","message_exception":"invalid_client"},"error_code":1002}
| Name | Passed | Failed | Skipped |
|---|---|---|---|
| Connect endpoint should return 200 when login with valid admin | 0 | 1 | 0 |
| Connect endpoint should return access_token and refresh_token | 1 | 0 | 0 |
| Total | 1 | 1 | 0 |
| Test Name | Assertion Error |
|---|---|
| Connect endpoint should return 200 when login with valid admin | |
| Header Name | Header Value |
|---|---|
| Content-Type | application/json |
| Accept | application/json, text/plain, */* |
| Authorization | OAuth="null" |
| Accept-Encoding | br, gzip, deflate |
| Host | api-preprod.happn.com |
| User-Agent | PostmanRuntime/7.26.8 |
| Cache-Control | no-cache |
| Postman-Token | 9c22d376-4e6f-4c82-95d2-5ce7e2f1b371 |
| Connection | keep-alive |
| Content-Length | 179 |
{
"type": "CLIENT",
"gender": "female",
"login": "main.user_1611667818103@example.com",
"first_name": "fake",
"last_name": "user",
"password": "00000000"
}
| Header Name | Header Value |
|---|---|
| Date | Tue, 26 Jan 2021 13:30:20 GMT |
| Content-Type | application/json |
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | GET, POST, PUT, DELETE, PATCH, OPTIONS |
| Access-Control-Max-Age | 0 |
| Access-Control-Allow-Headers | Authorization, Content-Type, X-Happn-CID, X-Happn-DID, X-HAPPN-VERSION, X-HAPPN-CARRIER-COUNTRY |
| X-Backend | legacy |
| Age | 0 |
| Cache-Control | max-age=0, no-cache, no-store, must-revalidate |
| Content-Length | 1804 |
| Connection | keep-alive |
{"success":false,"status":403,"error":"invalid_token","data":{"trace":"#0 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(910): Auth\\Service\\AuthService->decodeAccessToken('null', 'zB4Vo0TGzYV+uGQ...', NULL)\n#1 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(889): Auth\\Service\\AuthService->getAccessTokenArray('null')\n#2 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(789): Auth\\Service\\AuthService->getAccessToken('null')\n#3 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(711): Auth\\Service\\AuthService->verifyAccessToken()\n#4 \/var\/www\/happn-api\/application\/modules\/api\/controllers\/UsersController.php(75): Auth\\Service\\AuthService->checkAccessToken('user_create')\n#5 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Action.php(516): Api_UsersController->postAction()\n#6 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Dispatcher\/Standard.php(308): Zend_Controller_Action->dispatch('postAction')\n#7 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#8 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application\/Bootstrap\/Bootstrap.php(105): Zend_Controller_Front->dispatch()\n#9 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()\n#10 \/var\/www\/happn-api\/public\/index.php(102): Zend_Application->run()\n#11 {main}","message_exception":"invalid_token"},"error_code":1010}
| Name | Passed | Failed | Skipped |
|---|---|---|---|
| Admin user can create a new user | 0 | 1 | 0 |
| Total | 0 | 1 | 0 |
| Test Name | Assertion Error |
|---|---|
| Admin user can create a new user | |
| Header Name | Header Value |
|---|---|
| Content-Type | application/x-www-form-urlencoded |
| Pragma | no-cache |
| Accept | application/json, text/plain, */* |
| Host | varnish |
| User-Agent | PostmanRuntime/7.26.8 |
| Cache-Control | no-cache |
| Postman-Token | 6e4146e7-5c85-424b-bf1d-e8ba99fb630b |
| Accept-Encoding | gzip, deflate, br |
| Connection | keep-alive |
| Content-Length | 211 |
{"grant_type":"password","client_id":"sDDOEtsfJmfydw6Uos3F_YewFNoDzrxdsKN96OQK9e","client_secret":"HqP-3AgvmsFPOGFT9hsBx0F6a5xLc5NTQ5hxIz3Jfj","username":"main.user_1611667818103@example.com","password":"00000000","scope":"mobile_app"}
| Header Name | Header Value |
|---|---|
| Date | Tue, 26 Jan 2021 13:30:21 GMT |
| Content-Type | application/json |
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | GET, POST, PUT, DELETE, PATCH, OPTIONS |
| Access-Control-Max-Age | 0 |
| Access-Control-Allow-Headers | Authorization, Content-Type, X-Happn-CID, X-Happn-DID, X-HAPPN-VERSION, X-HAPPN-CARRIER-COUNTRY |
| X-Backend | legacy |
| Age | 0 |
| Cache-Control | max-age=0, no-cache, no-store, must-revalidate |
| Content-Length | 1372 |
| Connection | keep-alive |
{"success":false,"status":403,"error":"invalid_client","data":{"trace":"#0 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(212): Auth\\Service\\AuthService->extractAndValidateAuthParams(Array)\n#1 \/var\/www\/happn-api\/application\/modules\/connect\/controllers\/OauthController.php(53): Auth\\Service\\AuthService->grantAccessToken(Array)\n#2 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Action.php(516): Connect_OauthController->tokenAction()\n#3 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Dispatcher\/Standard.php(308): Zend_Controller_Action->dispatch('tokenAction')\n#4 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#5 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application\/Bootstrap\/Bootstrap.php(105): Zend_Controller_Front->dispatch()\n#6 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()\n#7 \/var\/www\/happn-api\/public\/index.php(102): Zend_Application->run()\n#8 {main}","message_exception":"invalid_client"},"error_code":1002}
| Name | Passed | Failed | Skipped |
|---|---|---|---|
| Connect endpoint should return 200 when login with created user | 0 | 1 | 0 |
| Connect endpoint should return access_token and refresh_token for a user | 1 | 0 | 0 |
| Total | 1 | 1 | 0 |
| Test Name | Assertion Error |
|---|---|
| Connect endpoint should return 200 when login with created user | |
| Header Name | Header Value |
|---|---|
| Host | varnish |
| CF-IPCountry | FR |
| Cookie | |
| Authorization | OAuth="null" |
| User-Agent | PostmanRuntime/7.26.8 |
| Accept | */* |
| Cache-Control | no-cache |
| Postman-Token | 61fdf849-675c-4828-8ce2-e6e0529276a8 |
| Accept-Encoding | gzip, deflate, br |
| Connection | keep-alive |
| Header Name | Header Value |
|---|---|
| Content-Type | application/json |
| Date | Tue, 26 Jan 2021 13:30:21 GMT |
| X-Backend | gateway |
| Age | 0 |
| Cache-Control | max-age=0, no-cache, no-store, must-revalidate |
| Content-Length | 72 |
| Connection | keep-alive |
{"status":403,"success":false,"error":"invalid_token","error_code":1010}
| Header Name | Header Value |
|---|---|
| Content-Type | application/json |
| Accept | application/json, text/plain, */* |
| Authorization | OAuth="invalidToken" |
| Accept-Encoding | br, gzip, deflate |
| Host | api-preprod.happn.com |
| User-Agent | PostmanRuntime/7.26.8 |
| Cache-Control | no-cache |
| Postman-Token | 6ba11cc6-7dd7-4d01-a83f-c89d7081996a |
| Connection | keep-alive |
| Content-Length | 179 |
{
"type": "CLIENT",
"gender": "female",
"login": "main.user_1611667821755@example.com",
"first_name": "fake",
"last_name": "user",
"password": "00000000"
}
| Header Name | Header Value |
|---|---|
| Date | Tue, 26 Jan 2021 13:30:22 GMT |
| Content-Type | application/json |
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | GET, POST, PUT, DELETE, PATCH, OPTIONS |
| Access-Control-Max-Age | 0 |
| Access-Control-Allow-Headers | Authorization, Content-Type, X-Happn-CID, X-Happn-DID, X-HAPPN-VERSION, X-HAPPN-CARRIER-COUNTRY |
| X-Backend | legacy |
| Age | 0 |
| Cache-Control | max-age=0, no-cache, no-store, must-revalidate |
| Content-Length | 1828 |
| Connection | keep-alive |
{"success":false,"status":403,"error":"invalid_token","data":{"trace":"#0 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(910): Auth\\Service\\AuthService->decodeAccessToken('invalidToken', 'zB4Vo0TGzYV+uGQ...', NULL)\n#1 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(889): Auth\\Service\\AuthService->getAccessTokenArray('invalidToken')\n#2 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(789): Auth\\Service\\AuthService->getAccessToken('invalidToken')\n#3 \/var\/www\/happn-api\/application\/services\/Auth\/Service\/AuthService.php(711): Auth\\Service\\AuthService->verifyAccessToken()\n#4 \/var\/www\/happn-api\/application\/modules\/api\/controllers\/UsersController.php(75): Auth\\Service\\AuthService->checkAccessToken('user_create')\n#5 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Action.php(516): Api_UsersController->postAction()\n#6 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Dispatcher\/Standard.php(308): Zend_Controller_Action->dispatch('postAction')\n#7 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Controller\/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#8 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application\/Bootstrap\/Bootstrap.php(105): Zend_Controller_Front->dispatch()\n#9 \/var\/www\/happn-api\/vendor\/zendframework\/zendframework1\/library\/Zend\/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()\n#10 \/var\/www\/happn-api\/public\/index.php(102): Zend_Application->run()\n#11 {main}","message_exception":"invalid_token"},"error_code":1010}
| Name | Passed | Failed | Skipped |
|---|---|---|---|
| User creation returns 403 when using invalid admin token | 1 | 0 | 0 |
| Error code should be invalid_token | 1 | 0 | 0 |
| Total | 2 | 0 | 0 |
| Test Name | Assertion Error |
|---|